package situ.autoweter.dao;

import com.sun.javafx.collections.MappingChange;
import org.apache.ibatis.annotations.*;
import situ.autoweter.entity.PyPay;
import situ.autoweter.entity.PyUserhistory;

import java.util.*;

import java.util.List;

@Mapper
public interface paywindowDao {
    //查询发票号
    @Select("select InvoiceNo from IV_Invoice where EmpID=1 and Used=0")
    List<Map> selectInvoiceNo();
    //以下是点确认交费之后要做的事情
    //修改用户余额
    @Update("update US_User set UserMoney=UserMoney+${money} where UserNO=${NO}")
    void  updateusermoney(@Param("NO") String NO,@Param("money") Double money);

    @Select("select top 8*,(select UserName from US_User where UserNo =p.UserNo) UserName from PY_Pay p where UserNo=#{value}")
    List<Map> queryPayByUserNo(String UserNo);

    @Select("select * from PY_UserHistory where UserNo=#{value}")
    List<Map> queryPY_UserHistoryByUserNo(String UserNo);
    //催费单
    @Select("select p.CreateDate,r.PreValue,r.CurValue,r.Amount,p.BillMoney,p.RealMoney from PY_Bill p,RD_Read r where r.ID=p.ReadID and p.UserNo=#{value} and Balance=0")
    List<Map>  queryChui(String UserNo);



}
